package code.nest.serializer;

import code.nest.dto.Protobufable;
import org.apache.kafka.common.serialization.Serializer;

import java.util.Map;

/**
 * @author ：Hyman
 * @date ：Created in 2021/6/29 18:52
 * @description：
 * @modified By：
 * @version: $
 */
public class ProtobufSerializer implements Serializer<Protobufable> {
    @Override
    public void configure(Map<String, ?> map, boolean b) {

    }

    @Override
    public byte[] serialize(String s, Protobufable protobufable) {
        return protobufable.encode();
    }

    @Override
    public void close() {

    }
}
